package org.bravo369.inflightxt.utils;

import org.json.JSONException;
import org.json.JSONObject;

public class Position {
  public Double latitude;
  public Double longitude;
  public Double altitude;
  public Double pitch;
  public Double roll;
  public Double heading;
  public long timestamp;
  public String session;

  public JSONObject toJSON() {
    JSONObject data = new JSONObject();
    try {
      data.put("lat", latitude);
      data.put("lon", longitude);
      data.put("alt", altitude);
      data.put("pitch", pitch);
      data.put("roll", roll);
      data.put("heading", heading);
      data.put("timestamp", timestamp);
      data.put("session", session);
      data = new JSONObject().put("Position", data);
    } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return data;
  }
}
